<include file="Public/header" />

  </head>
  
  <body>
    <div class="page-group">
      <div class="page page-current">
              <header class="bar bar-nav">
    <a class="button button-link button-nav pull-left back" href="javascript:window.history.go(-1)">
      <span class="icon icon-left"></span>
    </a>
    <h1 class="title">驾校详情</h1>
    <a class="button button-link button-nav pull-right" href="/">
                <span class="icon icon-home"></span>
    </a>
</header>
        <div class="content">
          <div class="dsinfo-head">
            <img src="{$member.head}">
            <p>{$member.name}</p>
            <span>{$member.address}</span>
            <ul>
              <li>
                <a href="tel:{$member.phone}">
                  <i class="icon icon-phone2"></i>联系客服</a>
              </li>
              <li>
                <a href="#" onclick="openMap({$member.lng},{$member.lat})">
                  <i class="icon icon-daohang"></i>驾校位置</a>
              </li>
              <li>
                <a href="{:U('Appointment/sc_app',array('school_id'=>$member['uid']))}">
                  <i class="icon icon-guanyingxiaoxi"></i>在线预约</a>
              </li>
            </ul>
          </div>

          <div class="class-type">
            <div class="ds-title">
              <ul>
                <li class="bgc sel" type="all" >
                  <i class="icon icon-list"></i>全部</li>
                <li class="sel" type="C1" >
                  <i class="icon icon-dache"></i>C1</li>
                <li class="sel" type="C2" >
                  <i class="icon icon-dache"></i>C2</li>
                <li class="sel" type="other" >
                  <i class="icon icon-qichepiao"></i>其他</li>
              </ul>班型信息</div>
            <div class="class-list" id="MemberList">

                <div class="more" id="more">
                  <p>加载更多</p>
                </div>
            </div>
            <div class="ds-title">驾校简介</div>
            <input type="hidden" name="uid" id="uid" value="{$member.uid}">

            <div class="profiles">
              {$member.content}
            
            </div>
          </div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xH9CkRR96Vk6KWM2KH5qhlsSncNgAGdQ"></script>
     <script type="text/javascript">
        var p=1;
        var uid=$('#uid').val();
        $(function(){
            getMore(p);
        });

        $("#more").click(function(){
            getMore(++p);
        });

        function getMore(p){
            var type = $('.bgc').attr('type');
            $.ajax({
                url:"{:U('memberlist')}",
                data:{p:p,uid:uid,type:type},
                type:'get',
                success:function(data){
                    $("#more").before(data);
                    if(data == ''){
                      $("#more").hide();
                    }else{
                      $("#more").show();
                    }
                }
            });
        }

        function openMap(lng,lat){
            
            layer.open({
              type: 1,
              skin: 'layui-layer-rim', //加上边框
              area: ['380px', '200px'], //宽高
              content: '<div>驾校位置</div><div id="allmap"></div>'
            });
            var map = new BMap.Map("allmap");    // 创建Map实例
            map.centerAndZoom(new BMap.Point(116.331398, 39.897445),16);  // 初始化地图,设置中心点坐标和地图级别
            //map.addControl(new BMap.MapTypeControl());   //添加地图类型控件
            map.setCurrentCity("河南");          // 设置地图显示的城市 此项是必须设置的
            //map.enableScrollWheelZoom(true);  

            var new_point = new BMap.Point(lng,lat);
            var marker = new BMap.Marker(new_point);  // 创建标注
            map.addOverlay(marker);              // 将标注添加到地图中
            map.panTo(new_point);  


            $('#allmap').css("overflow","");
            

        }

        $('.sel').click(function(){
          $('.sel').removeClass("bgc");
          $(this).addClass("bgc");
          $("#MemberList").find('ul').remove();
          p=1;
          getMore(p);
        });
    </script>
  </body>

</html>